package com.zhaoyh.mapper;

import com.zhaoyh.bean.IncomeRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 祥霸
 * @date 2019/2/12
 */
public interface IncomeRecordMapper {

    String TABLE_NAME = "incomeRecord";
    String SELECT_FIELDS = "entityID as 'entityID', " +
            "dataTime as 'dataTime', " +
            "money as 'money'";

    @Select({"SELECT", SELECT_FIELDS, "FROM", TABLE_NAME})
    List<IncomeRecord> selectIncomeRecordList();

    @Select({"SELECT COUNT(*) FROM", TABLE_NAME})
    int count();

    List<IncomeRecord> selectByLimitAndOffset(@Param("offset") Integer offset,
                                              @Param("limit") Integer limit);
}
